import React, { Component, useEffect, useReducer } from 'react';


function Child() {
    console.log('Child');
    return <div>Child</div>;
  }
  
  
  function Father(props) {
    const [num, setNum] = React.useState(0);
    return (
      <div onClick={() => {setNum(num + 1)}}>
        {num}
        {props.children}
      </div>
    );
  }
  
  
  function App() {
    return (
      <Father>
        <Child/>
      </Father>
    );
  }

  export default App;

  // 点击Father组件的div，Child会打印Child吗
  // 答案：不会，因为Child组件没有在Father组件的子元素列表中，所以不会渲染